<template>
	<view>
		<view class="goto_pay_box">
			<view class="goto_pay_up_box">
				<view class="xuna_box"></view>
				<text class="yiyuedu1">我已阅读并同意</text>
				<text class="yiyuedu2">《魔杰龙计划章程》</text>
				<text class="yiyuedu3">及</text>
				<text class="yiyuedu4">《隐私政策》</text>
			</view>
			
			<view class="goto_pay_button" @click="PayInfo">
				<view class="goto_button_text">
					<text>立即开通</text>
					<text class="goto_text_ind">¥368</text>
					<text>/季</text>
				</view>
			</view>
		</view>
		
		<!-- <u-popup
			:show="Is_login_show" 
			@close="Is_login_show = false" 
			mode="center"
		>
		<view>
			<view class="tan_modle">
				<view class="tan_title">请登陆</view>
				<view>
					<u-line></u-line>
					<view class="tan_button">
						<u-button text="取消" :plain="true" :hairline="false" @click="Is_login_show = false"></u-button>
						<u-button text="确认" type="primary" :plain="true" openType="getUserInfo" @click="userinfo"></u-button>
					</view>
				</view>
			</view>
		</view>
		</u-popup> -->
		
	</view>
</template>

<script>
	import ZnDaoqi from '@/pages/daoqi/daoqi.vue';
	import common from '@/utils/common.js';
	import HostConfig from '@/utils/host.js';
	import Host from '@/utils/api.js';
	const app = getApp();
	export default{
		data(){
			return{
				Is_login_show: getApp().globalData.LoginStatus,	// 判断用户是否已经登陆
				openid: '',
			}
		},
		methods:{
			PayInfo(){
				console.log('页面路径再U-tabbar')
				let that = this;
				if(app.globalData.openid){
					uni.request({
						url: Host.ApiCreateVipOrder.url, //创建会员订单
						method: 'GET',
						data:{
							openid: app.globalData.openid,
							goods_id: 0,
							goods_num: 0,
							order_pay_money: 368.00,
							order_typ: 'liji',
						},
						success: (res) => {
							that.orderid = res.data.result;
							uni.request({
								url: Host.ApipayVipOrder.url, //支付会员订单
								method: 'GET',
								data:{
									openid: app.globalData.openid,
									orderid: that.orderid
								},
								success: (res) => {
									
									uni.navigateTo({
										url: '/pages/index/index',
									})
								}
							});
						}
					});
				}
				return;
				uni.requestPayment({
					provider: 'wxpay',
					timeStamp: res.data.timeStamp.toString(),
					nonceStr: res.data.nonceStr,
					package: res.data.package,
					signType: 'MD5',
					paySign: res.data.sign,
					success: function(res) {
						console.log('success:' + JSON.stringify(res));
						uni.reLaunch({
							url:'/pages/index/index'
						})
					},
					fail: function(err) {
						console.log('fail:' + JSON.stringify(err));
						uni.showToast({
							position: 'center',
							title: '已取消支付',
							icon: 'none'
						})
					}
				});
			},
			
			userinfo(e){
			}
		}
	}
</script>

<style>
	page{
			background-color: #F6F8F9;
		}

		.goto_pay_box{
			background-color: #FFFFFF;
			height: 200upx;
			width: 100%;
			padding: 24upx 24upx 12upx 24upx;
			box-sizing: border-box;
		}
		.goto_pay_up_box{
			display: flex;
			align-items: center;
		}
		.xuna_box{
			width: 34upx;
			height: 34upx;
			opacity: 0.5;
			border: 2upx solid #3B4144;
			box-sizing: border-box;
			border-radius: 50%;
		}
		.yiyuedu1{
			font-size: 24upx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #333333;
			margin-left: 12upx;
		}
		.yiyuedu2{
			font-size: 24upx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #6EC5FF;
		}
		.yiyuedu3{
			font-size: 24upx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #333333;
		}
		.yiyuedu4{
			font-size: 24upx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #6EC5FF;
		}
		.goto_pay_button{
			margin-top: 24upx;
			width: 702upx;
			height: 106upx;
			background: #3B4144;
			border-radius: 6upx;
			display: flex;
			text-align: center;
			justify-content: center;
			align-items: center;
		}
		.goto_button_text{
	/* 		width: 284px;
			height: 66px; */
			font-size: 32upx;
			font-family: PingFangSC-Medium, PingFang SC;
			font-weight: 500;
			color: #FFC28D;
			line-height: 44upx;
			/* background: angular-gradient(360deg, #FFB779 0%, #FFECDC 69%, #FFDEC4 100%);
			-webkit-background-clip: text;
			-webkit-text-fill-color: transparent; */
		}
		.goto_text_ind{
			font-size: 36upx;
			font-family: PingFangSC-Medium, PingFang SC;
			font-weight: 500;
			color: #FFC28D;
			line-height: 44upx;
		}
		.zhengs_text3{
			/* width: 480upx; */
			position: absolute;
			height: 34upx;
			font-size: 24upx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #666666;
			line-height: 34upx;
		}
		.tan_modle{
			width: 580upx;
			height: 330upx;
			display: flex;
			justify-content: space-between;
			flex-direction: column;
		}
		.tan_title{
			height: 232upx;
			display: flex;
			justify-content: center;
			align-items: center;
			font-size: 32upx;
			font-family: PingFangSC-Medium, PingFang SC;
			font-weight: 500;
			color: #333333;
			line-height: 44upx;
		}
		.tan_button{
			display: flex;
			justify-content: space-between;
		}
</style>
